/*    */ package com.liy.cloud.auth.client.runner;
/*    */ 
/*    */ import com.liy.cloud.auth.client.config.UserAuthConfig;
/*    */ import com.liy.cloud.auth.client.feign.AuthorizationFeignClient;
/*    */ import com.das.framework.common.extvo.ResultVO;
/*    */ import com.das.framework.common.token.Base64Utils;
/*    */
import org.slf4j.Logger;
/*    */ import org.slf4j.LoggerFactory;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.boot.CommandLineRunner;
/*    */ import org.springframework.context.annotation.Configuration;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ @Configuration
/*    */ public class AuthClientRunner
/*    */   implements CommandLineRunner
/*    */ {
/* 22 */   protected static Logger log = LoggerFactory.getLogger(AuthClientRunner.class);
/*    */ 
/*    */ 
/*    */   
/*    */   @Autowired
/*    */   private UserAuthConfig keyConfig;
/*    */ 
/*    */ 
/*    */   
/*    */   @Autowired
/*    */   private AuthorizationFeignClient authorizationFeignClient;
/*    */ 
/*    */ 
/*    */   
/*    */   public void run(String... args) throws Exception {
/*    */     try {
/* 38 */       ResultVO resultVO = this.authorizationFeignClient.getUserPublicKey(this.keyConfig.getClientId(), this.keyConfig
/* 39 */           .getClientSecret());
/*    */       
/* 41 */       log.warn("Init authentication status: " + resultVO.getMessage());
/* 42 */       if (resultVO.isSuccess() && resultVO.getData() != null) {
/* 43 */         this.keyConfig.setPubKeyByte(Base64Utils.decode(resultVO.getData().toString()));
/*    */       }
/*    */     }
/* 46 */     catch (Exception e) {
/* 47 */       log.error("Init authentication key error: " + e.getMessage(), e);
/*    */     } 
/*    */   }
/*    */ }


/* Location:              C:\Users\admin\Desktop\Jar\das-cloud-osc\das-cloud-osc-auth-client-1.0.0-SNAPSHOT.jar!\com\das\cloud\auth\client\runner\AuthClientRunner.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.0.7
 */